If an XCMD is called with more than 16 parameters, an error message will appear.
outArgs[1] is guaranteed to be NIL if it is not a valid handle. In previous versions of HyperCard, XCMDs had to check for a result of xresFail to know if you had an invalid handle.
Errors from XCMDs no longer present dialogs to the user. As before, a result of xresFail informs the XCMD that an error has occurred. XCMDs are now free to try evaluating invalid expressions or sending messages that no one receives. They can tell from the result field whether they succeeded or not.
XCMDs can continue running even after an error has occurred. Previously, once an XMCD had evaluated an invalid expression, sent a message that was not caught, or otherwise caused an error, all subsequent callbacks would do nothing. Subsequent callbacks continue to work in HyperCard 1.2.1.
The user level must be set to Scripting to "peek" at scripts.
In the Browse tool:
Command-Option mouse click – Users can see scripts for any button by holding down the Command key and Option key, then clicking the mouse on the button they want to "peek" at. Once the script is visible, the script editor may be closed quickly by holding down Command-Option, then clicking the mouse or pressing any key. If the script has been changed, HyperCard will show an alert asking whether the changes should be saved.
Command-Option-c, -b, -s. While holding down the Command and Option keys, pressing "c", "b", or "s" will bring up the card, background or stack scripts respectively. Once the script is visible, the script editor may be closed quickly by holding down Command-Option, then clicking the mouse or pressing any key. If the script has been changed, HyperCard will ask whether the changes should be saved.
Shift-Command-Option-click lets you peek at all field and button scripts
(except hidden ones).
In the Button Tool, Command-Option-click lets you peek at button scripts (except hidden buttons).
In the Field Tool, Command-Option-click lets you peek at field scripts
• If there is a selection in a locked field, any typing or pasting goes to the
message box. The highlighted text in the field will be deselected. A
blinking insertion point in the field will be cleared.
• When a handler locks the screen, a number of changes will no longer
be visible to the user:
• The cursor won't change when tools change.
• The pattern palette won't change when new patterns are chosen.
• The tool palette won't change when new tools are chosen.
• The menu bar doesn't change when menu choices are made (for
example, when switching in and out of painting tools).
• The card window title bar doesn't change when the handler goes
to another stack.
When the screen is unlocked, changes will be updated.
• Using the Go command to go to a specific card id is much faster in
HyperCard 1.2.1. To take advantage of this, the stack must be
compacted with version 1.2.1.
• Using the command "Go first | next | last | any card of background
"foo"" is much faster in HyperCard 1.2.1. Again, the stack must
be compacted with version 1.2.1.
• Switching from the Browse, Button or Field tools to the Painting
tools is much faster.
• The container "the selection" will now hold 32K of data.
• For operations on fields, "me" can now be used as a container. In
the past, "me" always referred to the object - not to its contents.
In HyperCard 1.2.1, "me" can refer to the object or its contents.
Version 1.0.1 and 1.1:
get the name of me -- returns name of the the object
put "Fred" into me -- is incorrect syntax
put me into MyVar -- is incorrect syntax
Version 1.2.1:
get the name of me -- returns name of the object
put "Fred" into me -- or
put "Fred" into line 3 of me
-- puts the string "Fred" into the field (if "me" refers to a field or
-- variable)
put me into MyVar
-- puts the contents of the field into the
--variable MyVar
• In the past (for operations on fields) "the target" always referred to the object - not to its contents . In HyperCard 1.2.1, "target" refers to the contents of "the target". "The target" continues to refer explicitly to the object itself.
Version 1.0.1 and 1.1:
put the target -- puts the name of the object that last received a
-- message.
put target into MyVar -- is incorrect syntax
put "Fred" into target -- is incorrect syntax
Version 1.2.1:
put the target -- puts the name of the object that last received a
-- message
put target into MyVar
-- puts the contents of the field into the variable MyVar.
put "Fred" into target -- puts the string "Fred" into the field.
put value of the target -- is equivalent to "put target"
Note: These changes apply only to operations on fields, not to buttons, cards, backgrounds or stacks.
• Clicking the mouse in a text field while holding the Shift key down does the following:
When there is already text in the field: If the mouse click is below the last line of characters the insertion point is set after the last character in the field . If the mouse click is higher than the last line of characters, the text from the mouse location to the last character will be selected.
If the field is empty, the insertion point will be set at the beginning of the first line of the field.
In versions 1.0.1 and 1.1 of HyperCard, clicking the mouse below the last line of a field inserts Return characters in the empty lines above the location of the mouse click.
• Under MultiFinder 6.0, HyperCard will switch to other applications using HyperTalk"s "Open" command, if the desired application is already open.
• When the message box is empty or has spaces in it, HyperCard no longer complains when the Return key is pressed.
• The setGlobal glue routine will now create a global variable using the name you specify if it can't find an existing global with that name.
• If paint images overlapping a field are transparent, the card will print at high quality on the LaserWriter (not 72 dpi).
• The "Open Stack ..., New Stack..." and "Save a Copy..." menu items are now available while a painting tool is selected.
There are five ways to lock or write-protect a stack:
1. Put it on a CD-ROM.
2. Locked floppy disk-setting the write-protect tab on a
floppy disk.
3. Putting the stack into a read-only folder under
AppleShare, or limiting AppleShare access privileges
for the stack itself.
4. Checking the "locked" box in the stack"s Get Info
window in the Finder.
5. Setting cantModify to true in a script or by checking the
Can"t Modify box in the Protect Stack dialog (however,
setting cantModify to true in a stack is not sufficient to
allow multiple user access).
HyperCard detects the first four conditions and automatically sets cantModify and cantDelete to true. HyperCard shows a small padlock icon after the rightmost menu item when a stack is locked.
When a stack is locked and userModify is false, certain menu items are grayed out :
Scripts can determine whether the first four locking conditions are preventing permanent changes by testing cantModify. For example, a script can attempt to set cantModify to false, then check its state. For example:
on mouseUp
set cantModify of this stack to false
get cantModify of this stack
if it is true then ... -- the stack is on locked media
else -- the stack isn"t on locked media, and can be modified...
end if
end mouseUp
If the cantModify property of a stack is false before being placed on read-only media, and the stack is later copied to read-write media, cantModify will remain false.
Version Requirements - Using HyperCard 1.2.1's new commands will require the stack to be run using version 1.2.1. If none of the new syntax, synonyms, and commands are used, stacks created with version 1.2.1 will work fine with HyperCard versions 1.1 and 1.0.1. Compacting a stack with version 1.2.1 will neither help nor hinder its performance with other versions.
HyperTalk's function "the version" can be used to determine which version of HyperCard you are running under. For example:
if the version < "1.2" then set lockScreen to false
else unlock Screen with dissolve
Read-only media and stacks – No special commands are required to read a locked stack. But bear two things in mind when creating stacks that will be locked: First, all changes generated by scripts (such as showing a pop-up field) disappear when any move is made to another card. Second, assume the stack will be unlocked somewhere down the line. For example, if you have a field which pops up with a helpful tip for the user, don't rely on the behavior of the locked stack to hide the field when the user is through with it. Clean up after yourself.
Here's a list of things which cannot be done by either users or scripts on locked media:
• make new cards
• delete, cut or paste cards
• make new backgrounds
• compact the stack
• delete the stack
• edit patterns
• change the name of a stack
• change any scripts
• sort the stack
Changes to locked stacks are discarded by:
• choosing New Stack..., Open Stack..., Save a Copy...,
Print Stack..., or Print Report... from the File menu
• toggling to or from the background
• sublaunching another application (using the
open command)
• leaving the current card
• opening another stack
• quitting HyperCard
When cantModify is true, setting it to false discards any changes. When cantModify is false, setting it to false saves recent changes to the stack then sets the property.
"Print Stack..." rotates through the cards in the stack while generating the print job, thus any changes to a specific card in a locked or write-protected stack will be discarded before printing.
Multiple Users – Several users may read a stack if it's on a CD-ROM, set for read only access, or locked by the Finder. Setting cantModify to true in a stack is not sufficient to allow multiple user access. If one user opens a stack with read-write access (even with cantModify set to true), no other users can open it.
Hidden pictures –(Card or background) remain invisible until the user attempts to edit them. At that time, HyperCard shows an alert asking whether the picture should be shown. Scripts may make changes to a picture without showing the picture (no alerts will appear).
Copying Text and Graphics – Users may set an insertion point in a field to select or copy text, but generally can"t type into fields on locked stacks. The selection tools may be used to select or copy graphics from a locked stack.
Using userModify – If a script sets userModify to true, users can type in fields or paint on the card or background. UserModify"s default setting is false, and it is reset whenever you close or open a stack. (If you want to save the information the user entered, store it in a global variable.)
Printing – Cards on a locked stack can be printed in the usual way. If a card image is temporarily altered by a script or user, the image displayed on the screen will be printed (when "Print Card" is selected from the File menu), not the original card on the disk.
Ô£ø
-- part contents for background part 17
----- text -----
HyperCard v1.2.1 final programmer's notes • part 2